]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: add a SlidingControl for the dash actor
authorCosimo Cecchi <cosimoc@gnome.org>
Thu, 24 Jan 2013 04:11:23 +0000 (23:11 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Thu, 14 Feb 2013 23:18:22 +0000 (18:18 -0500)
Will be needed to hide and show it when searching.

https://bugzilla.gnome.org/show_bug.cgi?id=682050

data/theme/gnome-shell.css
js/ui/overview.js
js/ui/overviewControls.js

index e107ab86bce97c6a3a685ba90815a2201e436dbb..eb4340a4d32c9a73358824c0479d8d16887c444f 100644 (file)
@@ -772,15 +772,11 @@ StScrollBar StButton#vhandle:active {
 }
 
 #searchResultsContent {
+    padding-left: 20px;
     padding-right: 20px;
     spacing: 16px;
 }
 
-#searchResultsContent:rtl {
-    padding-right: 0px;
-    padding-left: 20px;
-}
-
 .search-section {
     /* This should be equal to #searchResultsContent spacing */
     spacing: 16px;
index adff625184d84542d62bf69a1b6c86e58ce5e897..399bd191defcc4b7bb65d6167fa00e3f76a8b3fc 100644 (file)
@@ -225,13 +225,15 @@ const Overview = new Lang.Class({
 
         // TODO - recalculate everything when desktop size changes
         this._dash = new Dash.Dash();
-        this._group.add_actor(this._dash.actor);
         this.dashIconSize = this._dash.iconSize;
         this._dash.connect('icon-size-changed',
                            Lang.bind(this, function() {
                                this.dashIconSize = this._dash.iconSize;
                            }));
 
+        this._dashSlider = new OverviewControls.DashSlider(this._dash);
+        this._group.add_actor(this._dashSlider.actor);
+
         // Translators: this is the name of the dock/favorites area on
         // the left of the overview
         Main.ctrlAltTabManager.addGroup(this._dash.actor, _("Dash"), 'user-bookmarks-symbolic');
index 61c3e3f70d2b4d3583b2ed52737926e389382624..8413874ba94241b7a55b610621e1e8a19c567141 100644 (file)
@@ -203,3 +203,32 @@ const ThumbnailsSlider = new Lang.Class({
         return visibleWidth / expandedWidth;
     }
 });
+
+const DashSlider = new Lang.Class({
+    Name: 'DashSlider',
+    Extends: SlidingControl,
+
+    _init: function(dash) {
+        this.parent();
+
+        this.layout.slideDirection = SlideDirection.LEFT;
+
+        this.dash = dash;
+
+        // SlideLayout reads the actor's expand flags to decide
+        // whether to allocate the natural size to its child, or the whole
+        // available allocation
+        dash.actor.x_expand = true;
+        dash.actor.y_expand = true;
+        this.actor.add_actor(this.dash.actor);
+
+        this.dash.connect('icon-size-changed', Lang.bind(this, this.updateSlide));
+    },
+
+    getSlide: function() {
+        if (this.visible || this.inDrag)
+            return 1;
+        else
+            return 0;
+    }
+});